package com.wyd.principle.SingleResponsbility;

public class SingleResponsbility01 {
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("飞机");
        vehicle.run("汽车");
        vehicle.run("轮船");
    }
}

/**
 * 违反单一职责原则
 * Vehicle负责了路面、水面、航空等多种交通工具的运行
 */
class Vehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + "在公路上奔跑……");
    }
}